package com.zbkj.crmeb.enums;

/**
 * 供应商类型
 * @date 2020/9/28 18:58
 */
public enum SupplierTypeEnum {
    VINTNER(1,"酒商"),

    WINERY(2,"酒庄"),

    SUPERMARKET(3, "商超"),

    PLATFORM(4, "电商平台");

    Integer type;

    String typeName;

    public Integer getType() {
        return type;
    }

    public String getTypeName() {
        return typeName;
    }

    private SupplierTypeEnum(Integer type, String typeName){
        this.type = type;
        this.typeName = typeName;
    }
    public static SupplierTypeEnum getTypeByCode(Integer type){
        if(type != null){
            for(SupplierTypeEnum val : SupplierTypeEnum.values()){
                if(val.type.equals(type)){
                    return val;
                }
            }
        }
        return VINTNER;
    }
}
